package com.minimalist.common.entity.lindi.vo.tradeapplicationconfirmletter;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.minimalist.common.config.mybatis.bo.PageReq;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Objects;

/**
 * 林地指标交易平台_交易申请确认函查询 VO实体
 * <p>
 * 用于查询交易申请确认函的查询条件封装，继承分页查询基类
 * 支持按确认函基本信息、时间范围等条件进行查询
 *
 * @author 11987
 */
@Schema(name = "林地指标交易平台_交易申请确认函查询实体")
public class LindiTradeApplicationConfirmLetterQueryVO extends PageReq implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    // ========== 基本查询条件 ==========

    /**
     * 交易申请ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @Schema(name = "tradeApplicationId", description = "交易申请ID", type = "string")
    private Long tradeApplicationId;

    /**
     * 确认函名称
     */
    @Schema(name = "confirmLetterName", description = "确认函名称", type = "string")
    private String confirmLetterName;

    /**
     * 确认函编号
     */
    @Schema(name = "confirmLetterCode", description = "确认函编号", type = "string")
    private String confirmLetterCode;

    /**
     * 确认函类型
     */
    @Schema(name = "confirmLetterType", description = "确认函类型", type = "string")
    private String confirmLetterType;

    // ========== 时间范围查询条件 ==========

    /**
     * 签订时间开始
     */
    @Schema(name = "signDateStart", description = "签订时间开始", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime signDateStart;

    /**
     * 签订时间结束
     */
    @Schema(name = "signDateEnd", description = "签订时间结束", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime signDateEnd;

    /**
     * 创建时间开始
     */
    @Schema(name = "createTimeStart", description = "创建时间开始", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTimeStart;

    /**
     * 创建时间结束
     */
    @Schema(name = "createTimeEnd", description = "创建时间结束", type = "string")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    private LocalDateTime createTimeEnd;

    // ========== 构造函数 ==========


    public LindiTradeApplicationConfirmLetterQueryVO(Long pageNum, Long pageSize){
        super(pageNum, pageSize);
    }

    /**
     * 全参数构造函数
     *
     * @param pageNum            页码
     * @param pageSize           页大小
     * @param tradeApplicationId 交易申请ID
     * @param confirmLetterName  确认函名称
     * @param confirmLetterCode  确认函编号
     * @param confirmLetterType  确认函类型
     * @param signDateStart      签订时间开始
     * @param signDateEnd        签订时间结束
     * @param createTimeStart    创建时间开始
     * @param createTimeEnd      创建时间结束
     */
    public LindiTradeApplicationConfirmLetterQueryVO(Long pageNum, Long pageSize,
                                                     Long tradeApplicationId, String confirmLetterName,
                                                     String confirmLetterCode, String confirmLetterType,
                                                     LocalDateTime signDateStart, LocalDateTime signDateEnd,
                                                     LocalDateTime createTimeStart, LocalDateTime createTimeEnd){
        super(pageNum, pageSize);
        this.tradeApplicationId = tradeApplicationId;
        this.confirmLetterName = confirmLetterName;
        this.confirmLetterCode = confirmLetterCode;
        this.confirmLetterType = confirmLetterType;
        this.signDateStart = signDateStart;
        this.signDateEnd = signDateEnd;
        this.createTimeStart = createTimeStart;
        this.createTimeEnd = createTimeEnd;
    }

    // ========== Getter 和 Setter 方法 ==========

    public Long getTradeApplicationId(){
        return tradeApplicationId;
    }

    public void setTradeApplicationId(Long tradeApplicationId){
        this.tradeApplicationId = tradeApplicationId;
    }

    public String getConfirmLetterName(){
        return confirmLetterName;
    }

    public void setConfirmLetterName(String confirmLetterName){
        this.confirmLetterName = confirmLetterName;
    }

    public String getConfirmLetterCode(){
        return confirmLetterCode;
    }

    public void setConfirmLetterCode(String confirmLetterCode){
        this.confirmLetterCode = confirmLetterCode;
    }

    public String getConfirmLetterType(){
        return confirmLetterType;
    }

    public void setConfirmLetterType(String confirmLetterType){
        this.confirmLetterType = confirmLetterType;
    }

    public LocalDateTime getSignDateStart(){
        return signDateStart;
    }

    public void setSignDateStart(LocalDateTime signDateStart){
        this.signDateStart = signDateStart;
    }

    public LocalDateTime getSignDateEnd(){
        return signDateEnd;
    }

    public void setSignDateEnd(LocalDateTime signDateEnd){
        this.signDateEnd = signDateEnd;
    }

    public LocalDateTime getCreateTimeStart(){
        return createTimeStart;
    }

    public void setCreateTimeStart(LocalDateTime createTimeStart){
        this.createTimeStart = createTimeStart;
    }

    public LocalDateTime getCreateTimeEnd(){
        return createTimeEnd;
    }

    public void setCreateTimeEnd(LocalDateTime createTimeEnd){
        this.createTimeEnd = createTimeEnd;
    }

    // ========== Object 方法重写 ==========

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }

        LindiTradeApplicationConfirmLetterQueryVO that = (LindiTradeApplicationConfirmLetterQueryVO) o;

        return Objects.equals(tradeApplicationId, that.tradeApplicationId) &&
                Objects.equals(confirmLetterName, that.confirmLetterName) &&
                Objects.equals(confirmLetterCode, that.confirmLetterCode) &&
                Objects.equals(confirmLetterType, that.confirmLetterType) &&
                Objects.equals(signDateStart, that.signDateStart) &&
                Objects.equals(signDateEnd, that.signDateEnd) &&
                Objects.equals(createTimeStart, that.createTimeStart) &&
                Objects.equals(createTimeEnd, that.createTimeEnd);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), tradeApplicationId, confirmLetterName,
                confirmLetterCode, confirmLetterType, signDateStart,
                signDateEnd, createTimeStart, createTimeEnd);
    }

    @Override
    public String toString(){
        return "LindiTradeApplicationConfirmLetterQueryVO{" +
                "tradeApplicationId=" + tradeApplicationId +
                ", confirmLetterName='" + confirmLetterName + '\'' +
                ", confirmLetterCode='" + confirmLetterCode + '\'' +
                ", confirmLetterType='" + confirmLetterType + '\'' +
                ", signDateStart=" + signDateStart +
                ", signDateEnd=" + signDateEnd +
                ", createTimeStart=" + createTimeStart +
                ", createTimeEnd=" + createTimeEnd +
                "} " + super.toString();
    }
}
